package cn.gson.fengboot.controller;

import cn.gson.fengboot.aspect.MyLog;
import cn.gson.fengboot.model.pojos.Dscheme;
import cn.gson.fengboot.model.service.DschemeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@RestController
@RequestMapping("/business/scheme")
public class DschemeController {


    @Autowired
    DschemeService service;

    @RequestMapping("/selectscheme")
    public List<Dscheme> selectscheme(Integer busId){
        return service.selectscheme(busId);
    }

    /*新增解决方案*/
    @RequestMapping("/addscheme")
    @MyLog(modul = "售前模块",desc = "新增解决方案")
    public void addscheme(@RequestBody Dscheme dscheme){
        service.addscheme(dscheme);
    }

    @RequestMapping("/selectBytype")
    public List<Object> selectBytype(String type,Integer busId, HttpServletRequest request){
        System.out.println(type);
        return service.selectBytype(type,busId,request);
    }

    @RequestMapping("/verifymyscheme")
    public Dscheme verifymyscheme(String schemeTheme,HttpServletRequest request){
        return service.verifymyscheme(schemeTheme,request);
    }

}
